/**
 * @author AdinZ
 * @date 2022/12/30 18:33
 *
 */

export const activityTypes = [
    {value: 'SPIKE', label: '极速秒杀'},
    {value: 'LOTTERY', label: '幸运转盘'},
    {value: 'GROUP', label: '玩转拼团'},
    {value: 'BARGAIN', label: '全名砍价'},
    {value: 'APPLY', label: '报名'},
    {value: 'CARD', label: '次卡'},
    {value: 'SOLITAIRE', label: '接龙'},
    {value: 'VOTE', label: '投票'},
    {value: 'LOTTERY_AD', label: '广告'},
]
/**
 * 活动类型
 * @param type
 * @returns {*}
 */
export const activityType = (type) => {
    let data = {};

    if (!type) return ''
    activityTypes.forEach(e => {
        if (e.value === type) {
            data = e;
            return true;
        }
    })
    return data.label;
}


export const activityStatuses = [
    {value: 0, label: '未开始'},
    {value: 1, label: '进行中'},
    {value: 2, label: '已结束'},
]

/**
 * 活动状态
 * @param status
 * @returns {*}
 */
export const activityStatus = (status) => {
    let data = {}
    activityStatuses.forEach(e => {
        if (e.value == status || e.value == Number(status)) {
            data = e;
            return true;
        }
    })
    return data.label;
}




export const orderStatuses=[
    {label: '等待支付', value: 'WAIT_PAY'},
    {label: '等待使用', value: 'WAIT_USE'},
    {label: '待成团', value: 'WAIT_GROUP'},
    {label: '订单关闭', value: 'CLOSE'},
    {label: '转出', value: 'GIFT'},
    {label: '订单关闭', value: 'CLOSE'},
    {label: '待评论', value: 'WAIT_COMMENT'},
    {label: '成团失败', value: 'GROUP_FAIL'},
    {label: '交易完成', value: 'COMPLETE'},
]
export const orderStatus=(status)=>{
    if (status === 'WAIT_PAY')
        return `<span class="el-tag el-tag--warning mx-1 is-round"><span class="el-tag__content">待付款</span></span>`
    else if (status === 'WAIT_USE') return `<span class="el-tag el-tag--info1 mx-1 is-round"><span class="el-tag__content">待使用</span></span>`
    else if (status === 'WAIT_GROUP') return `<span class="el-tag el-tag--warning mx-1 is-round"><span class="el-tag__content">待成团</span></span>`
    else if (status === 'CLOSE') return `<span class="el-tag el-tag--danger el-tag--dark mx-1 is-round"><span class="el-tag__content">订单关闭</span> </span>`
    else if (status === 'REFUND') return `<span class="el-tag el-tag--danger el-tag--dark mx-1 is-round"><span class="el-tag__content">退款</span> </span>`
    else if (status === 'GROUP_FAIL') return `<span class="el-tag el-tag--danger el-tag--dark mx-1 is-round"><span class="el-tag__content">成团失败</span> </span>`
    else if (status === 'GIFT') return `<span class="el-tag el-tag--danger el-tag--dark mx-1 is-round"><span class="el-tag__content">转出</span> </span>`
    else if (status === 'WAIT_COMMENT') return `<span class="el-tag el-tag--primary el-tag--dark mx-1 is-round"><span class="el-tag__content">待评论</span> </span>`
    else if (status === 'COMPLETE') return `<span class="el-tag el-tag--success el-tag--dark mx-1 is-round"><span class="el-tag__content">交易完成</span> </span>`
    else return status
}

